import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class ObjectOutputStreamDemo {
    public static void main(String[] args) throws IOException {
        ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("MyFile\\src\\tmp\\oos.txt"));
        stu_oos stu = new stu_oos("Jon",23);
        oos.writeObject(stu);
        oos.close();
    }
}
